import Vue from 'vue'
import VueRouter from 'vue-router'
import bookrack from '../views/bookrack.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/my'
  },
  // 书架
  {
    path: '/bookrack',
    name: 'bookrack',
    component: bookrack
  },
  // 书城
  {
    path: '/bookmall',
    name: 'bookmall',
    component: () => import('../views/bookmall.vue')
  },
  // 我的界面
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my.vue')
  },
  // 登录
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  // 书城热门
  {
    path: '/hots',
    name: 'hots',
    component: () => import('../components/bookmall/hots.vue')
  },
  // 书城分类
  {
    path: '/classification',
    name: 'classification',
    component: () => import('../components/bookmall/classification.vue')
  },
  // 书城榜单
  {
    path: '/ranking',
    name: 'ranking',
    component: () => import('../components/bookmall/ranking.vue')
  },
  // 书籍详情
  {
    path: '/bookdetails',
    name: 'bookdetails',
    component: () => import('../components/base/bookdetails.vue')
  },
  // 搜索
  {
    path: '/search',
    name: 'search',
    component: () => import('../components/base/search.vue')
  },
  // 搜索结果
  {
    path: '/searchres',
    name: 'searchres',
    component: () => import('../components/base/searchres.vue')
  },
  // 书单列表
  {
    path: '/booklists',
    name: 'booklists',
    component: () => import('../components/base/booklists.vue')
  },

  //  阅读
  {
    path: '/reading',
    name: 'reading',
    component: () => import('../components/base/reading.vue')
  },
  // 最近阅读
  {
    path: '/recentlyread',
    name: 'recentlyread',
    component: () => import('../components/base/recentlyread.vue')
  },
  // 我的消息
  {
    path: '/mynews',
    name: 'mynews',
    component: () => import('../components/base/mynews.vue')
  },
  {
    path: '/mybooklist',
    name: 'mybooklist',
    component: () => import('../components/base/mybooklist.vue')
  },

]

const router = new VueRouter({
  routes
})
export default router
